modules/zstd: Add support for decoding compressed blocks#1857
modules/zstd: Add support for decoding compressed blocks#1857lpawelcz wants to merge 103 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
47ab08c to
50f6140
Compare
50f6140 to
36bc838
Compare
|
Can we rebase and consolidate with #1654 ? |
36bc838 to
16cd455
Compare
| @@ -0,0 +1,170 @@ | |||
| # Copyright 2024 The XLS Authors | |||
There was a problem hiding this comment.
can. you add a docstring about what the module is doing and where it is being used?
There was a problem hiding this comment.
Added the docstring
| @@ -0,0 +1,33 @@ | |||
| # Copyright 2024 The XLS Authors | |||
There was a problem hiding this comment.
can. you add a docstring about what those external are and why they are needed?
There was a problem hiding this comment.
Added the docstring and a License file for the third party sources
xls/modules/rle/rle_common.x
Outdated
| last: bool, // flush RLE | ||
| } | ||
|
|
||
| // Structure contains multiple uncompressed symbols. |
There was a problem hiding this comment.
It seems like it is not used in this version of the ZSTD Decoder. Let's just remove it for now.
| @@ -0,0 +1,753 @@ | |||
| // Copyright 2024 The XLS Authors | |||
There was a problem hiding this comment.
can. you add a docstring about what the module is and why it is needed? (if it's for driving the cocostb test maybe move it there or in a separate rtl folder?)
There was a problem hiding this comment.
Moved to a separate rtl directory and added short description
| @@ -0,0 +1,193 @@ | |||
| // Copyright 2024 The XLS Authors | |||
There was a problem hiding this comment.
can you move the verilog file in a separate rtl directory w/ a README (or docstring describing the modules)?
There was a problem hiding this comment.
Moved to a separate rtl directory and added short description
|
can you also rebase? |
16cd455 to
cae18b3
Compare
| cocotb==1.9.0 | ||
| cocotbext-axi==0.1.24 | ||
| cocotb_bus==0.2.1 | ||
| zstandard==0.23.0 |
There was a problem hiding this comment.
q: does this need to be in sync w/ the C++ dep?
There was a problem hiding this comment.
Since we dropped the C++ tests for the ZSTD Decoder I believe those don't have to be in sync
cae18b3 to
70cbb9d
Compare
|
Addressed the review comments, apart from that:
|
There was a problem hiding this comment.
Done - there's a license header now.
| @@ -0,0 +1,418 @@ | |||
| /* | |||
There was a problem hiding this comment.
I think this has to go in third_party, since it is not authored by a contributor.
There was a problem hiding this comment.
This has been moved to third_party/verilog_axi.
| @@ -0,0 +1,391 @@ | |||
| /* | |||
There was a problem hiding this comment.
I think this has to go in third_party, since it is not authored by a contributor.
There was a problem hiding this comment.
This has been moved to third_party/verilog_axi.
| @@ -0,0 +1,21 @@ | |||
| pub struct DataArray<BITS_PER_WORD: u32, LENGTH: u32>{ | |||
There was a problem hiding this comment.
Done - there's a license header now.
| @@ -0,0 +1,21 @@ | |||
| pub struct DataArray<BITS_PER_WORD: u32, LENGTH: u32>{ | |||
There was a problem hiding this comment.
Done - there's a license header now.
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
* Use materialize_internal_fifos when possible * Disable the above option for procs with loopback channels * Add missing module names * Add xls_fifo_wrapper verilog dependency to the synthesis of the procs without materialized internal fifos Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
No longer applicable - there are no CC tests in ZSTD module Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
Signed-off-by: Robert Winkler <rwinkler@antmicro.com>
Co-authored-by: Szymon Gizler <sgizler@antmicro.com>
1f89c87 to
412eb98
Compare
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
de1ee9a to
d77223d
Compare
d77223d to
b327068
Compare
| @@ -0,0 +1,226 @@ | |||
| // Copyright 2024 The XLS Authors | |||
There was a problem hiding this comment.
make sure to wrap line to 100 characters in that file.
cb9d65d to
35a215a
Compare
xls/modules/zstd/README.md
Outdated
| which did not have the `last` flag set | ||
| * DecoderMux | ||
| * At the beginning of the simulation or after receiving | ||
| `ExtendedBlockDataPacket` with `last` and `last_block` (decoding new ZSTD |
Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
35a215a to
6836389
Compare
| z3-solver==4.14.0.0 | ||
| pytest==8.2.2 | ||
| cocotb==1.9.0 | ||
| cocotbext-axi==0.1.24 |
There was a problem hiding this comment.
I don't think this is available in our internal repository, so it would be better to untie this dependency for now and remove the associated script from the PR and import them separately.
| # use pypi version | ||
| z3-solver==4.14.0.0 | ||
| pytest==8.2.2 | ||
| cocotb==1.9.0 |
There was a problem hiding this comment.
FYI, internally we are on v1.7.1, so if there is anything that's specific to 1.9.0, will need to upgrade the internal copy of cocotb first; as I commented elsewhere it might be better to untie this and the associated python tests from this PR and import this separately.
| pytest==8.2.2 | ||
| cocotb==1.9.0 | ||
| cocotbext-axi==0.1.24 | ||
| cocotb_bus==0.2.1 |
There was a problem hiding this comment.
Same here, this is not available yet internally and will need to be imported separately.
| cocotb==1.9.0 | ||
| cocotbext-axi==0.1.24 | ||
| cocotb_bus==0.2.1 | ||
| zstandard==0.23.0 |
There was a problem hiding this comment.
FYI, internally this is on 0.19.0
| # We build most of z3 ourselves but building python is really complicated. Just | ||
| # use pypi version | ||
| z3-solver==4.14.0.0 | ||
| pytest==8.2.2 |
| @@ -17,11 +17,11 @@ | |||
| load("@rules_hdl//place_and_route:build_defs.bzl", "place_and_route") | |||
There was a problem hiding this comment.
consider adding https://google.github.io/xls/bazel_rules_macros/#xls_dslx_fmt_test to enforce DSLX formatting.
There was a problem hiding this comment.
I think you also want to consider running https://google.github.io/xls/bazel_rules_macros/#xls_dslx_fmt_test to enforce DSLX formatting as part of the CI.
|
super seeded by #2230 |
This PR extends the
ZstdDecoderwith support for decoding compressed blocks.It supersedes PRs:
The decoder is capable of decoding RAW and RLE literals as well as sequences with predefined FSE tables.
A suite of DSLX tests comprising unit tests of all underlying procs and an integration test was prepared.
The integration test, similarly as in #1654, first generates a random valid ZSTD frame with compressed blocks and expected decoded output. Test data is then converted to a DSLX file (example) that is imported by the integration tests file.
At the beginning of the test, the default FSE decoding tables are filled with default distributions taken from RFC 8878 section 3.1.1.3.2.2. Default Distributions . Next, the encoded frame is loaded to the system memory and the decoder is configured through a set of CSRs to start the decoding process. The decoder starts the operation and writes the decoded frame back into the output buffer in the system memory. Once it finishes, it sends a pulse on the
notifychannel signaling the end of the decoding. The output of the decoder is compared against the decoding result from the reference library.The PR introduces among others:
CompressedBlockDecoder- manages bothSequenceDecoderandLiteralsDecoderto enable compress block decoding. Integrated with the top-levelZstdDecoderSequenceDecoder- responsible for decoding sequence sections of the compressed blocksFseDecoder- introduced as the core part of theSequenceDecoderRefillingShiftBuffer- used for storing and outputting in forward and backward fashion an arbitrary amount of bits required by the FSE decoderLiteralsDecoder- capable of decoding RAW, RLE and Huffman-coded literalsHuffmanDecoder- used in decoding huffman-coded literals. Decoded Huffman trees are then used to decode one or four Huffman-coded streams.CommandConstructor- this proc is responsible for sending packets with decoded sequences and literals to theSequenceExecutorprocRamMuxandRamDemux- procs used for handling requests/responses to multiple memory models. The procs interface with 3 separate memory buffers for FSE decoding tables.